package com.qire.manhua.dal.service;

import com.qire.antsbinder.dal.DataService;
import com.qire.antsbinder.dal.annotation.StrategyAnnotation;
import com.qire.common.basic.ObjectUtil;
import com.qire.common.constant.Url;
import com.qire.common.dal.WarehouseFactory;
import com.qire.common.utils.ToastHelper;
import com.qire.common.widget.snackbar.Prompt;
import com.qire.manhua.dal.ITaskDataDAL;
import com.qire.manhua.model.vo.TaskStateResponseVO;

public class TaskReportService extends DataService {

    private final ITaskDataDAL taskDataDAL = WarehouseFactory.create(this, ITaskDataDAL.class);

    /**
     * 分享漫画任务上报接口
     */
    public void shareComicTaskReport() {
        taskDataDAL.shareComicTaskReport();
    }
    @StrategyAnnotation(event = Url.ShareComicTaskReport)
    public void shareComicTaskReportApiCallBack(TaskStateResponseVO taskStateVO, boolean isCache) {
        if(ObjectUtil.nonNull(taskStateVO) && taskStateVO.isSuccess()) {
            ToastHelper.showSnackBar("分享1部漫画任务已完成", Prompt.SUCCESS, 300);
        }
    }
}
